package com.ahaoyou.servicel.impl;

import com.ahaoyou.annotation.DataSource;
import com.ahaoyou.entity.HelloWorld;
import com.ahaoyou.mapper.HelloWorldMapper;
import com.ahaoyou.servicel.HelloWorldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @Author LH
 * @Date 2021-09-26 16:26
 */
@Service
public class HelloWorldServiceImpl implements HelloWorldService {

    @Autowired
    private HelloWorldMapper helloWorldMapper;

    @Override
    @DataSource("fluent")
    public List<HelloWorld> findAll() {
        return helloWorldMapper.findAll();
    }

    @Override
    @DataSource("fluent")
    public int batchInsert(List<HelloWorld> helloWorlds) {
        return helloWorldMapper.batchInsert(helloWorlds);
    }

}